From: Jo-Philipp Wich Date: Mon, 1 Mar 2021 07:54:06 +0000 (+0100) Subject: luci-base: firewall.js: manage zomne networks as list X-Git-Url: http://git.openwrt.org/%22https:/collectd.org/%22http:/www.crowdsec.net//%22https%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22https%22?a=commitdiff_plain;h=5e807edb23d873a56c64ed3b42c2f7e10736e3ce;p=project%2Fluci.git luci-base: firewall.js: manage zomne networks as list Fixes: #4827 Signed-off-by: Jo-Philipp Wich (cherry picked from commit 49ecaf60902be2e43ccec3c61bc6b7d0b41da251) --- diff --git a/modules/luci-base/htdocs/luci-static/resources/firewall.js b/modules/luci-base/htdocs/luci-static/resources/firewall.js index b1c7de4358..594492050c 100644 --- a/modules/luci-base/htdocs/luci-static/resources/firewall.js +++ b/modules/luci-base/htdocs/luci-static/resources/firewall.js @@ -106,7 +106,6 @@ Firewall = L.Class.extend({ z = uci.add('firewall', 'zone'); uci.set('firewall', z, 'name', name); - uci.set('firewall', z, 'network', ' '); uci.set('firewall', z, 'input', d.getInput() || 'DROP'); uci.set('firewall', z, 'output', d.getOutput() || 'DROP'); uci.set('firewall', z, 'forward', d.getForward() || 'DROP'); @@ -347,17 +346,17 @@ Zone = AbstractFirewallItem.extend({ return false; newNetworks.push(network); - this.set('network', newNetworks.join(' ')); + this.set('network', newNetworks); return true; }, deleteNetwork: function(network) { var oldNetworks = this.getNetworks(), - newNetworks = oldNetworks.filter(function(net) { return net != network }); + newNetworks = oldNetworks.filter(function(net) { return net != network }); if (newNetworks.length > 0) - this.set('network', newNetworks.join(' ')); + this.set('network', newNetworks); else this.set('network', null); @@ -369,7 +368,7 @@ Zone = AbstractFirewallItem.extend({ }, clearNetworks: function() { - this.set('network', ' '); + this.set('network', null); }, getDevices: function() {